home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_500-100.asp < prev    next >
Encoding:
Text File  |  1999-11-18  |  6.9 KB  |  230 lines

  1. <%@ language="VBScript" %>
  2. <%
  3.   Option Explicit
  4.  
  5.   Const lngMaxFormBytes = 200
  6.  
  7.   Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP
  8.   Dim strMethod, lngPos, datNow, strQueryString, strURL
  9.  
  10.   If Response.Buffer Then
  11.     Response.Clear
  12.     Response.Status = "500 Internal Server Error"
  13.     Response.ContentType = "text/html"
  14.     Response.Expires = 0
  15.   End If
  16.  
  17.   Set objASPError = Server.GetLastError
  18. %>
  19. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  20.  
  21. <html dir=ltr>
  22.  
  23. <head>
  24. <style>
  25. a:link            {font:8pt/11pt verdana; color:FF0000}
  26. a:visited        {font:8pt/11pt verdana; color:#4e4e4e}
  27. </style>
  28.  
  29. <META NAME="ROBOTS" CONTENT="NOINDEX">
  30.  
  31. <title>The page cannot be displayed</title>
  32.  
  33. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  34. </head>
  35.  
  36. <script> 
  37. function Homepage(){
  38. <!--
  39. // in real bits, urls get returned to our script like this:
  40. // res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm 
  41.  
  42.     //For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
  43.     DocURL=document.URL;
  44.     
  45.     //this is where the http or https will be, as found by searching for :// but skipping the res://
  46.     protocolIndex=DocURL.indexOf("://",4);
  47.     
  48.     //this finds the ending slash for the domain server 
  49.     serverIndex=DocURL.indexOf("/",protocolIndex + 3);
  50.  
  51.     //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining 
  52.     //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
  53.     //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
  54.     BeginURL=DocURL.indexOf("#",1) + 1;
  55.     urlresult=DocURL.substring(BeginURL,serverIndex);
  56.         
  57.     //for display, we need to skip after http://, and go to the next slash
  58.     displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
  59.     document.write('<A HREF="' + urlresult + '">' + displayresult + "</a>");
  60. }
  61. //-->
  62. </script>
  63.  
  64. <body bgcolor="FFFFFF">
  65.  
  66. <table width="410" cellpadding="3" cellspacing="5">
  67.  
  68.   <tr>    
  69.     <td align="left" valign="middle" width="360">
  70.     <h1 style="COLOR:000000; FONT: 13pt/15pt verdana"><!--Problem-->The page cannot be displayed</h1>
  71.     </td>
  72.   </tr>
  73.   
  74.   <tr>
  75.     <td width="400" colspan="2">
  76.     <font style="COLOR:000000; FONT: 8pt/11pt verdana">There is a problem with the page you are trying to reach and it cannot be displayed.</font></td>
  77.   </tr>
  78.   
  79.   <tr>
  80.     <td width="400" colspan="2">
  81.     <font style="COLOR:000000; FONT: 8pt/11pt verdana">
  82.  
  83.     <hr color="#C0C0C0" noshade>
  84.     
  85.     <p>Please try the following:</p>
  86.  
  87.     <ul>
  88.       <li id="instructionsText1">Click the 
  89.       <a href="javascript:location.reload()">
  90.       Refresh</a> button, or try again later.<br>
  91.       </li>
  92.       
  93.       <li>Open the 
  94.       
  95.       <script>
  96.       <!--
  97.       if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))
  98.       {
  99.            Homepage();
  100.       }
  101.       //-->
  102.       </script>
  103.  
  104.       home page, and then look for links to the information you want. </li>
  105.     </ul>
  106.     
  107.     <h2 style="font:8pt/11pt verdana; color:000000">HTTP 500.100 - Internal Server
  108.     Error - ASP error<br>
  109.     Internet Information Services</h2>
  110.  
  111.     <hr color="#C0C0C0" noshade>
  112.     
  113.     <p>Technical Information (for support personnel)</p>
  114.  
  115. <ul>
  116. <li>Error Type:<br>
  117. <%
  118.   Dim bakCodepage
  119.   on error resume next
  120.       bakCodepage = Session.Codepage
  121.       Session.Codepage = 1252
  122.   on error goto 0
  123.   Response.Write Server.HTMLEncode(objASPError.Category)
  124.   If objASPError.ASPCode > "" Then Response.Write Server.HTMLEncode(", " & objASPError.ASPCode)
  125.   Response.Write Server.HTMLEncode(" (0x" & Hex(objASPError.Number) & ")" ) & "<br>"
  126.  
  127.   If objASPError.ASPDescription > "" Then 
  128.         Response.Write Server.HTMLEncode(objASPError.ASPDescription) & "<br>"
  129.  
  130.   elseIf (objASPError.Description > "") Then 
  131.          Response.Write Server.HTMLEncode(objASPError.Description) & "<br>" 
  132.   end if
  133.  
  134.  
  135.  
  136.   blnErrorWritten = False
  137.  
  138.   ' Only show the Source if it is available and the request is from the same machine as IIS
  139.   If objASPError.Source > "" Then
  140.     strServername = LCase(Request.ServerVariables("SERVER_NAME"))
  141.     strServerIP = Request.ServerVariables("LOCAL_ADDR")
  142.     strRemoteIP =  Request.ServerVariables("REMOTE_ADDR")
  143.     If (strServername = "localhost" Or strServerIP = strRemoteIP) And objASPError.File <> "?" Then
  144.       Response.Write Server.HTMLEncode(objASPError.File)
  145.       If objASPError.Line > 0 Then Response.Write ", line " & objASPError.Line
  146.       If objASPError.Column > 0 Then Response.Write ", column " & objASPError.Column
  147.       Response.Write "<br>"
  148.       Response.Write "<font style=""COLOR:000000; FONT: 8pt/11pt courier new""><b>"
  149.       Response.Write Server.HTMLEncode(objASPError.Source) & "<br>"
  150.       If objASPError.Column > 0 Then Response.Write String((objASPError.Column - 1), "-") & "^<br>"
  151.       Response.Write "</b></font>"
  152.       blnErrorWritten = True
  153.     End If
  154.   End If
  155.  
  156.   If Not blnErrorWritten And objASPError.File <> "?" Then
  157.     Response.Write "<b>" & Server.HTMLEncode(  objASPError.File)
  158.     If objASPError.Line > 0 Then Response.Write Server.HTMLEncode(", line " & objASPError.Line)
  159.     If objASPError.Column > 0 Then Response.Write ", column " & objASPError.Column
  160.     Response.Write "</b><br>"
  161.   End If
  162. %>
  163. </li>
  164. <p>
  165. <li>Browser Type:<br>
  166. <%= Request.ServerVariables("HTTP_USER_AGENT") %>
  167. </li>
  168. <p>
  169. <li>Page:<br>
  170. <%
  171.   strMethod = Request.ServerVariables("REQUEST_METHOD")
  172.  
  173.   Response.Write strMethod & " "
  174.  
  175.   If strMethod = "POST" Then
  176.     Response.Write Request.TotalBytes & " bytes to "
  177.   End If
  178.  
  179.   Response.Write Request.ServerVariables("SCRIPT_NAME")
  180.  
  181.   lngPos = InStr(Request.QueryString, "|")
  182.  
  183.   If lngPos > 1 Then
  184.     Response.Write "?" & Left(Request.QueryString, (lngPos - 1))
  185.   End If
  186.  
  187.   Response.Write "</li>"
  188.  
  189.   If strMethod = "POST" Then
  190.     Response.Write "<p><li>POST Data:<br>"
  191.     If Request.TotalBytes > lngMaxFormBytes Then
  192.        Response.Write Server.HTMLEncode(Left(Request.Form, lngMaxFormBytes)) & " . . ."
  193.     Else
  194.       Response.Write Server.HTMLEncode(Request.Form)
  195.     End If
  196.     Response.Write "</li>"
  197.   End If
  198.  
  199. %>
  200. <p>
  201. <li>Time:<br>
  202. <%
  203.   datNow = Now()
  204.  
  205.   Response.Write Server.HTMLEncode(FormatDateTime(datNow, 1) & ", " & FormatDateTime(datNow, 3))
  206.   on error resume next
  207.       Session.Codepage = bakCodepage 
  208.   on error goto 0
  209. %>
  210. </li>
  211. </p>
  212. <p>
  213. <li>More information:<br>
  214.  <%  strQueryString = "prd=iis&sbp=&pver=5.0&ID=500;100&cat=" & Server.URLEncode(objASPError.Category) & _
  215.     "&os=&over=&hrd=&Opt1=" & Server.URLEncode(objASPError.ASPCode)  & "&Opt2=" & Server.URLEncode(objASPError.Number) & _
  216.     "&Opt3=" & Server.URLEncode(objASPError.Description) 
  217.        strURL = "http://www.microsoft.com/ContentRedirect.asp?" & _
  218.     strQueryString
  219. %>
  220. <a href="<%= strURL %>">Microsoft Support</a>
  221. </li>
  222. </p>
  223.  
  224.     </font></td>
  225.   </tr>
  226.   
  227. </table>
  228. </body>
  229. </html>
  230.